package com.applink.sell_proof.database.table;

import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

import com.applink.sell_proof.EMarketing;
import com.applink.sell_proof.constant.Constant;

public class SPreferences {

	public static boolean hasFetchedData(String tablename) {
		SharedPreferences settings = EMarketing.getInstance()
				.getSharedPreferences(Constant.SHAREDPREFERENCE_NAME, 0);

		if (settings.getString(tablename, "0").equals("1"))
			return true;

		return false;
	}

	public static void setFetched(String tablename) {
		
		Editor editor = EMarketing.getInstance().getApplicationContext()
				.getSharedPreferences(Constant.SHAREDPREFERENCE_NAME, 0).edit();

		editor.putString(tablename, "1");

		editor.commit();
	}
}
